﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

public partial class Laborage : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        Page.Title = "我的工资详情";
        scjrm.WebServiceGZ Web = new scjrm.WebServiceGZ();
        if (Session["UID"] != null)
        {

            string UID = Session["UID"].ToString();
            string YGBH = Session["ygbh"].ToString();
            string XINGMING = Session["xingming"].ToString();
            string ZJM = Session["zjm"].ToString();
            string KL = Session["kl"].ToString();
            if (KL == "202CB962AC59075B964B07152D234B70")
            {
                Response.Redirect("Repass.aspx");
            }
            DataSet dsMonth = Web.GetInfoMonth(0,100,YGBH);
            if (dsMonth != null)
            {
                if (!IsPostBack)
                {
                    //显示记录集的记录
                    DropDownList1.DataSource = dsMonth.Tables[0].DefaultView;//指定DropDownList使用的表里的那些字段
                    DropDownList1.DataTextField = "月份"; //dropdownlist的Text的字段
                    DropDownList1.DataValueField = "月份";//dropdownlist的Value的字段
                    DropDownList1.DataBind();
                }
            }
            else
            {
                this.Response.Write("加载数据错误!");
            }

            DataSet dsinfouser = Web.GetInfoUserName("shensoft", YGBH);
            if (dsinfouser != null)
            {
                if (!IsPostBack)
                {
                    //显示记录集的记录
                    DropDownList2.DataSource = dsinfouser.Tables[0].DefaultView;//指定DropDownList使用的表里的那些字段
                    DropDownList2.DataTextField = "xingming"; //dropdownlist的Text的字段
                    DropDownList2.DataValueField = "ygbh";//dropdownlist的Value的字段
                    DropDownList2.DataBind();
                    //DropDownList2.SelectedIndex=11;
                    DropDownList2.SelectedValue = YGBH;
                }
            }
            else
            {
                this.Response.Write("加载数据错误!");
            }

        }
        else
        {
            Session.Abandon();
            //清空
            Session.Clear();
            Response.Redirect("Login.aspx");
        }
    }
    protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e)
    {

    }
    protected void DropDownList2_SelectedIndexChanged(object sender, EventArgs e)
    {

    }
    protected void submit_Click(object sender, EventArgs e)
    {
        string rqtime = DropDownList1.SelectedItem.Text;
        string YGBH = DropDownList2.SelectedItem.Value;

        scjrm.WebServiceGZ Web = new scjrm.WebServiceGZ();


        string GetInfoNote = Web.GetInfoUser("shensoft", YGBH);
        string[] InfoNoteArray = GetInfoNote.Split('|');
        /**
        IDinfo.Text = "<li>【部门/岗位：" + InfoNoteArray[9].ToString() + "/" + InfoNoteArray[10].ToString() + "】</li>" +
              "<li>【身份证号码：" + InfoNoteArray[0].ToString() + "】</li>" +
          "<li>【性别：" + InfoNoteArray[1].ToString() + "】【出生：" + InfoNoteArray[2].ToString() + "】</li>" +
          "<li>【入司：" + InfoNoteArray[3].ToString() + "】【状态：" + InfoNoteArray[4].ToString() + "】</li>" +
          "<li>【开户银行：" + InfoNoteArray[5].ToString() + "】</li>" +
          "<li>【银行账号：" + InfoNoteArray[6].ToString() + "】</li>" +
          "<li>【电话：" + InfoNoteArray[7].ToString() + "】【离职时间：" + InfoNoteArray[8].ToString() + "】</li>";
        **/
        string GetNote = Web.GetLaborageInfo(YGBH, rqtime);
        string[] NoteArray = GetNote.Split('|');
        //GetInfo.Text = "<ul class=\"oa-ul\"><li class=\"oa-li\"><font color=#ff0000>月份：" + NoteArray[0].ToString() + "</font></li></ul>"
        GetInfo.Text = ""
                        + "<ul class=\"oa-ul\">"
                        + "<li class=\"oa-li\">基本工资：" + NoteArray[1].ToString() + "</li>"
                        + "<li class=\"oa-li\">岗位工资：" + NoteArray[2].ToString() + "</li>"
                        + "<li class=\"oa-li\">岗位补贴：" + NoteArray[3].ToString() + "</li>"
                        + "<li class=\"oa-li\">工龄工资：" + NoteArray[4].ToString() + "</li>"
                        + "<li class=\"oa-li\">实发/应发绩效：" + NoteArray[5].ToString() + "(" + NoteArray[6].ToString() + ")</li>"
                        + "<li class=\"oa-li\">加班：" + NoteArray[7].ToString() + "</li>"
                        + "<li class=\"oa-li\">电话费：" + NoteArray[8].ToString() + "</li>"
                        + "<li class=\"oa-li\">交通：" + NoteArray[9].ToString() + "</li>"
                        + "<li class=\"oa-li\">提成：" + NoteArray[10].ToString() + "</li>"
                        + "<li class=\"oa-li\">其它：" + NoteArray[11].ToString() + "</li>"
                        + "</ul>"
                        + "<ul class=\"oa-ul\">"
                        + "<li class=\"oa-li\"><b><font color=#ff0000>应发合计：" + NoteArray[12].ToString() + "</font></b></li>"
                        + "</ul>"
                        + "<ul class=\"oa-ul\">"
                        + "<li class=\"oa-li\">考勤：" + NoteArray[13].ToString() + "</li>"
                        + "<li class=\"oa-li\">违纪：" + NoteArray[14].ToString() + "</li>"
                        + "<li class=\"oa-li\">保险：" + NoteArray[15].ToString() + "</li>"
                        + "<li class=\"oa-li\">公积金：" + NoteArray[16].ToString() + "</li>"                        
                        + "</ul>"
                        + "<ul class=\"oa-ul\">"
                        + "<li class=\"oa-li\"><b><font color=#ff0000>应扣合计：" + NoteArray[17].ToString() + "</font></b></li>"
                        + "</ul>"
                        + "<ul class=\"oa-ul\">"
                        + "<li class=\"oa-li\"><b><font color=#ff0000>税前工资：" + NoteArray[18].ToString() + "</font></b></li>"
                        + "</ul>"
                        + "<ul class=\"oa-ul\">"
                        + "<li class=\"oa-li\">所得税：</li>"
                        + "<li class=\"oa-li\">扣减金额：" + NoteArray[19].ToString() + "</li>"
                        + "<li class=\"oa-li\">应扣税金：" + NoteArray[20].ToString() + "</li>"
                        + "<li class=\"oa-li\">个税：" + NoteArray[21].ToString() + "</li>"
                        + "<li class=\"oa-li\">税率：" + NoteArray[22].ToString() + "</li>"
                        + "<li class=\"oa-li\">扣除数" + NoteArray[23].ToString() + "</li>"
                        + "</ul>"
                        + "<ul class=\"oa-ul\">"
                        + "<li class=\"oa-li\"><b><font color=#ff0000>税后工资：" + NoteArray[24].ToString() + "</font></b></li>"
                        + "</ul>"
                        + "<ul class=\"oa-ul\">"
                        + "<li class=\"oa-li\">水电：" + NoteArray[25].ToString() + "</li>"
                        + "<li class=\"oa-li\">培训：" + NoteArray[26].ToString() + "</li>"
                        + "<li class=\"oa-li\">其它代扣：" + NoteArray[27].ToString() + "</li>"
                        +"</ul>"
                        + "<ul class=\"oa-ul\">"
                        + "<li class=\"oa-li\">代扣合计：" + NoteArray[28].ToString() + "</li>"
                        + "</ul>"
                        + "<ul class=\"oa-ul\">"
                        + "<li class=\"oa-li\"><b><font color=#ff0000>实发工资：" + NoteArray[29].ToString() + "</font></b></li>"
                        + "</ul>"
                        + "<ul class=\"oa-ul\">"
                        + "<li class=\"oa-liw\">备注：" + NoteArray[33].ToString() + "<font color=#ff0000>有不详信息请至人力资源部咨询</font></li>"
                        + "</ul>"
                        + "<ul class=\"oa-ul\">"
                        + "<li class=\"oa-liw\">个税计算方式：<font color=#ff0000>(税前工资-扣减金额-5000.00)*税率-扣除数=应扣税金额</font></li>"
                        + "</ul>"
                        + "<ul class=\"oa-ul\">"
                        + "<li class=\"oa-li\">绩效分" + NoteArray[30].ToString() + "</li>"
                        + "<li class=\"oa-li\">绩效系数" + NoteArray[31].ToString() + "</li>"
                        + "<li class=\"oa-li\">薪点值" + NoteArray[32].ToString() + "</li>"
                        + "</ul>";
    }
}
